/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.upcolbpip.impl;

import ar.edu.utn.frsf.cidisi.upcolbpip.UPColBPIPModel;
import ar.edu.utn.frsf.cidisi.upcolbpip.UpcolbpipPackage;

import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.B2BCollaboration;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>UP Col BPIP Model</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.impl.UPColBPIPModelImpl#getName <em>Name</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.impl.UPColBPIPModelImpl#getB2bCollaboration <em>B2b Collaboration</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.impl.UPColBPIPModelImpl#getBusinessDocumentOntology <em>Business Document Ontology</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.impl.UPColBPIPModelImpl#getContentLanguage <em>Content Language</em>}</li>
 *   <li>{@link ar.edu.utn.frsf.cidisi.upcolbpip.impl.UPColBPIPModelImpl#getLanguageActionLibrary <em>Language Action Library</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class UPColBPIPModelImpl extends EObjectImpl implements UPColBPIPModel {
	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The cached value of the '{@link #getB2bCollaboration() <em>B2b Collaboration</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getB2bCollaboration()
	 * @generated
	 * @ordered
	 */
	protected B2BCollaboration b2bCollaboration;

	/**
	 * The default value of the '{@link #getBusinessDocumentOntology() <em>Business Document Ontology</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBusinessDocumentOntology()
	 * @generated
	 * @ordered
	 */
	protected static final String BUSINESS_DOCUMENT_ONTOLOGY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getBusinessDocumentOntology() <em>Business Document Ontology</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBusinessDocumentOntology()
	 * @generated
	 * @ordered
	 */
	protected String businessDocumentOntology = BUSINESS_DOCUMENT_ONTOLOGY_EDEFAULT;

	/**
	 * The default value of the '{@link #getContentLanguage() <em>Content Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContentLanguage()
	 * @generated
	 * @ordered
	 */
	protected static final String CONTENT_LANGUAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getContentLanguage() <em>Content Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContentLanguage()
	 * @generated
	 * @ordered
	 */
	protected String contentLanguage = CONTENT_LANGUAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getLanguageActionLibrary() <em>Language Action Library</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguageActionLibrary()
	 * @generated
	 * @ordered
	 */
	protected static final String LANGUAGE_ACTION_LIBRARY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLanguageActionLibrary() <em>Language Action Library</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguageActionLibrary()
	 * @generated
	 * @ordered
	 */
	protected String languageActionLibrary = LANGUAGE_ACTION_LIBRARY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected UPColBPIPModelImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return UpcolbpipPackage.Literals.UP_COL_BPIP_MODEL;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2BCollaboration getB2bCollaboration() {
		return b2bCollaboration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetB2bCollaboration(B2BCollaboration newB2bCollaboration, NotificationChain msgs) {
		B2BCollaboration oldB2bCollaboration = b2bCollaboration;
		b2bCollaboration = newB2bCollaboration;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION, oldB2bCollaboration, newB2bCollaboration);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setB2bCollaboration(B2BCollaboration newB2bCollaboration) {
		if (newB2bCollaboration != b2bCollaboration) {
			NotificationChain msgs = null;
			if (b2bCollaboration != null)
				msgs = ((InternalEObject)b2bCollaboration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION, null, msgs);
			if (newB2bCollaboration != null)
				msgs = ((InternalEObject)newB2bCollaboration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION, null, msgs);
			msgs = basicSetB2bCollaboration(newB2bCollaboration, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION, newB2bCollaboration, newB2bCollaboration));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getBusinessDocumentOntology() {
		return businessDocumentOntology;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBusinessDocumentOntology(String newBusinessDocumentOntology) {
		String oldBusinessDocumentOntology = businessDocumentOntology;
		businessDocumentOntology = newBusinessDocumentOntology;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__BUSINESS_DOCUMENT_ONTOLOGY, oldBusinessDocumentOntology, businessDocumentOntology));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getContentLanguage() {
		return contentLanguage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setContentLanguage(String newContentLanguage) {
		String oldContentLanguage = contentLanguage;
		contentLanguage = newContentLanguage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__CONTENT_LANGUAGE, oldContentLanguage, contentLanguage));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLanguageActionLibrary() {
		return languageActionLibrary;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLanguageActionLibrary(String newLanguageActionLibrary) {
		String oldLanguageActionLibrary = languageActionLibrary;
		languageActionLibrary = newLanguageActionLibrary;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, UpcolbpipPackage.UP_COL_BPIP_MODEL__LANGUAGE_ACTION_LIBRARY, oldLanguageActionLibrary, languageActionLibrary));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION:
				return basicSetB2bCollaboration(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__NAME:
				return getName();
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION:
				return getB2bCollaboration();
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__BUSINESS_DOCUMENT_ONTOLOGY:
				return getBusinessDocumentOntology();
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__CONTENT_LANGUAGE:
				return getContentLanguage();
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__LANGUAGE_ACTION_LIBRARY:
				return getLanguageActionLibrary();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__NAME:
				setName((String)newValue);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION:
				setB2bCollaboration((B2BCollaboration)newValue);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__BUSINESS_DOCUMENT_ONTOLOGY:
				setBusinessDocumentOntology((String)newValue);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__CONTENT_LANGUAGE:
				setContentLanguage((String)newValue);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__LANGUAGE_ACTION_LIBRARY:
				setLanguageActionLibrary((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__NAME:
				setName(NAME_EDEFAULT);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION:
				setB2bCollaboration((B2BCollaboration)null);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__BUSINESS_DOCUMENT_ONTOLOGY:
				setBusinessDocumentOntology(BUSINESS_DOCUMENT_ONTOLOGY_EDEFAULT);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__CONTENT_LANGUAGE:
				setContentLanguage(CONTENT_LANGUAGE_EDEFAULT);
				return;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__LANGUAGE_ACTION_LIBRARY:
				setLanguageActionLibrary(LANGUAGE_ACTION_LIBRARY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__B2B_COLLABORATION:
				return b2bCollaboration != null;
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__BUSINESS_DOCUMENT_ONTOLOGY:
				return BUSINESS_DOCUMENT_ONTOLOGY_EDEFAULT == null ? businessDocumentOntology != null : !BUSINESS_DOCUMENT_ONTOLOGY_EDEFAULT.equals(businessDocumentOntology);
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__CONTENT_LANGUAGE:
				return CONTENT_LANGUAGE_EDEFAULT == null ? contentLanguage != null : !CONTENT_LANGUAGE_EDEFAULT.equals(contentLanguage);
			case UpcolbpipPackage.UP_COL_BPIP_MODEL__LANGUAGE_ACTION_LIBRARY:
				return LANGUAGE_ACTION_LIBRARY_EDEFAULT == null ? languageActionLibrary != null : !LANGUAGE_ACTION_LIBRARY_EDEFAULT.equals(languageActionLibrary);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (name: ");
		result.append(name);
		result.append(", businessDocumentOntology: ");
		result.append(businessDocumentOntology);
		result.append(", contentLanguage: ");
		result.append(contentLanguage);
		result.append(", languageActionLibrary: ");
		result.append(languageActionLibrary);
		result.append(')');
		return result.toString();
	}

} //UPColBPIPModelImpl
